{% extends 'layout/basic.html' %}
{% load static %}
{% block title %}修改密码{% endblock %}
{% block css %}
    <link rel="stylesheet" href="{% static 'css/account.css' %}">
{% endblock %}

{% block content %}

    <div class="account">
        <!-- novalidate 关闭浏览器校验 -->
        <div class="title">修改密码</div>
        <form id="changepwd" method="post" novalidate>
            {% csrf_token %}
            {% for field in form %}
                <div class="form-group">
                    <label for="{{ field.id_for_label }}">{{ field.label }}:</label>
                    {{ field }}
                    <span class="error-msg">{{ field.errors.0 }}</span>
                </div>

            {% endfor %}

            <div class="row">

                <div class="col-xs-7">
                    <button id='reset' type="button" class="btn btn-primary btn-sm">
                        <i class="fa fa-refresh" aria-hidden="true"> 重置</i>

                    </button>

                    <input type="submit" class="btn btn-success btn-sm" value="Change Password">

                </div>


            </div>

        </form>
    </div>




{% endblock %}


{% block js %}
    <script>
        $(function () {
            BindClickEmpty();
        })


        function BindClickEmpty() {
            $('#reset').click(function () {
                $('.error-msg').empty();
                $('#id_old_pwd').val('');    //  对 value值写入空字符
                $('#id_new_pwd').val('');
                $('#id_confirm_pwd').val('');

            })
        }


    </script>
{% endblock %}